package com.thememaker.lockstyle;

/**
 * Created by jiajun.jiang on 2018/2/22.
 */
public class Eltest {

    public static void main(String[] args) {


//        String exp = "(year%100)/10";
//        Scope scope = new Scope();
//        Expression parsiiExpr = null;
//        try {
//            Variable var = scope.getVariable("year");
//            var.setValue(2018);
//            parsiiExpr = Parser.parse(exp,scope);
//            scope.getVariable("touch_y").setValue(194);
//            double result = parsiiExpr.evaluate();
//            System.out.println((int)result);
//        } catch (ParseException e) {
//            e.printStackTrace();
//        }
//        try {
//            Lockscreen lockscreen = (Lockscreen) XmlUtils.xml2java(Lockscreen.class,"C:\\Users\\jiajun.jiang\\Desktop\\lockstyle\\advance\\manifest.xml");
//            XmlUtils.java2xml(lockscreen,Lockscreen.class,"C:\\Users\\jiajun.jiang\\Desktop\\lockstyle\\advance\\manifest33.xml");
//
//        } catch (JAXBException e) {
//            e.printStackTrace();
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//        ExpressionUtils.getInstance(1080,1920).parseExpr("11");

//        Document document =  ReadXmlUtils.loadXml("E:\\主题\\测试锁屏主题\\vivo\\lockstyle\\lockscreen\\manifest.xml");
//        Lockscreen lockscreen = LockstylePaserUtils.paserLockScreenXml(document);
//        LinkedHashMap<String,BaseView> map = lockscreen.getLockScreenViewMap();
//        map.keySet().forEach(name->{
//            BaseView baseView = map.get(name);
//            if (baseView instanceof Image){
//                System.err.println("X >>> " + baseView.getX());
//            }
//        });
//        LockstylePaserUtils.saveLockScreenXml(document,lockscreen.getLockScreenViewMap(),new File("C:\\Users\\jiajun.jiang\\Desktop\\lockstyle\\advance\\manifest44.xml"));
//        try {
//            FileUtils.iteratorDirToStream(new File("E:\\1080包"),true).forEach(path -> {
//                System.err.println("path >>> " + path.toString());
//                PackThemeExecutorService packThemeExecutorService=new PackThemeExecutorService();
//                packThemeExecutorService.unzipThemeFile(path.toFile());
//            });
//        } catch (IOException e) {
//            e.printStackTrace();
//        }

    }

}
